package io.github.i678.startertools.listeners;

import io.github.i678.namedutils.api.Staffchat;

import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;

public class Listeners implements Listener {

    @EventHandler
    public void chatEvent(AsyncPlayerChatEvent ev) {
        if(!Staffchat.isEnabled()) return;
        if(!Staffchat.staffchatToggled(ev.getPlayer().getName())) return;
        ev.setCancelled(true);
        Staffchat.chat(ev.getMessage(), ev.getPlayer());
    }

}